<!--
<script type="text/javascript">
  var age = document.getElementById('ageId').value;
  alert(age)
</script>
-->

<form name="register" action="" method="post">

  <input type="text" name="email"
  onClick="alert(this.name)" placeholder="click event"/>

  <input type="text" name="uname"
  onBlur="alert(this.value)" placeholder="blur event"/>

  <input type="text"  id="passwordId" name="password"
  onChange="alert(this.value)" placeholder="change event"/>

  <input type="text" name="confirm"
  onblur="alert(document.getElementById('passwordId').value)" placeholder="get change event value"/>

  <input type="text"  id="passwordId" name="password"
  onClick="alert(document.register.uname.value)" placeholder="get blur event value"/>

  <input type="text" name="age" value="34" id="ageId" />

  <input type="submit" />
</form>

<script type="text/javascript">
  var age = document.getElementById('ageId').value;
  alert(age)
</script>
